﻿using Contract;
using System;
using System.Collections.Generic;
using System.Text;

namespace HRX.PayCenter.Contract
{
    /// <summary>
    /// 扩展结果结
    /// </summary>
    public static class ResultSetExtension
    {
        public static ResultSet<T> Success<T>(this ResultSet<T> resultSet, T data)
        {
            resultSet.Data = data;
            resultSet.Code = 0;

            return resultSet;
        }

        public static ResultSet<T> Fail<T>(this ResultSet<T> resultSet, int code, string message, T data)
        {
            resultSet.Code = code;
            resultSet.Message = message;
            resultSet.Data = data;
            return resultSet;
        }
    }
}
